using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._SpatialStatisticsTools._AnalyzingPatterns
{
    /// <summary>
    /// <para>Incremental Spatial Autocorrelation</para>
    /// <para>Measures spatial autocorrelation for a series of distances and optionally creates a line graph of those distances and their corresponding z-scores.  Z-scores reflect the intensity of spatial clustering, and statistically significant peak z-scores indicate distances where spatial processes promoting clustering are most pronounced.  These peak distances are often appropriate values to use for tools with a Distance Band or Distance Radius parameter.</para>
    /// <para>测量一系列距离的空间自相关，并可选择创建这些距离及其相应 z 分数的折线图。 Z 分数反映了空间聚类的强度，具有统计学意义的峰值 z 分数表示促进聚类的空间过程最明显的距离。 这些峰值距离通常是用于具有“距离带”或“距离半径”参数的工具的适当值。</para>
    /// </summary>    
    [DisplayName("Incremental Spatial Autocorrelation")]
    public class IncrementalSpatialAutocorrelation : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public IncrementalSpatialAutocorrelation()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_Input_Features">
        /// <para>Input Features</para>
        /// <para>The feature class for which spatial autocorrelation will be measured over a series of distances.</para>
        /// <para>将在一系列距离上测量空间自相关的要素类。</para>
        /// </param>
        /// <param name="_Input_Field">
        /// <para>Input Field</para>
        /// <para>The numeric field used in assessing spatial autocorrelation.</para>
        /// <para>用于评估空间自相关的数值字段。</para>
        /// </param>
        /// <param name="_Number_of_Distance_Bands">
        /// <para>Number of Distance Bands</para>
        /// <para>The number of times to increment the neighborhood size and analyze the dataset for spatial autocorrelation. The starting point and size of the increment are specified in the Beginning Distance and Distance Increment parameters, respectively.</para>
        /// <para>递增邻域大小并分析数据集的空间自相关的次数。增量的起点和大小分别在“起始距离”和“距离增量”参数中指定。</para>
        /// </param>
        public IncrementalSpatialAutocorrelation(object _Input_Features, object _Input_Field, long _Number_of_Distance_Bands)
        {
            this._Input_Features = _Input_Features;
            this._Input_Field = _Input_Field;
            this._Number_of_Distance_Bands = _Number_of_Distance_Bands;
        }
        public override string ToolboxName => "Spatial Statistics Tools";

        public override string ToolName => "Incremental Spatial Autocorrelation";

        public override string CallName => "stats.IncrementalSpatialAutocorrelation";

        public override List<string> AcceptEnvironments => ["geographicTransformations", "outputCoordinateSystem", "scratchWorkspace", "workspace"];

        public override object[] ParameterInfo => [_Input_Features, _Input_Field, _Number_of_Distance_Bands, _Beginning_Distance, _Distance_Increment, _Distance_Method.GetGPValue(), _Row_Standardization.GetGPValue(), _Output_Table, _Output_Report_File, _First_Peak, _Max_Peak];

        /// <summary>
        /// <para>Input Features</para>
        /// <para>The feature class for which spatial autocorrelation will be measured over a series of distances.</para>
        /// <para>将在一系列距离上测量空间自相关的要素类。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _Input_Features { get; set; }


        /// <summary>
        /// <para>Input Field</para>
        /// <para>The numeric field used in assessing spatial autocorrelation.</para>
        /// <para>用于评估空间自相关的数值字段。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Field")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _Input_Field { get; set; }


        /// <summary>
        /// <para>Number of Distance Bands</para>
        /// <para>The number of times to increment the neighborhood size and analyze the dataset for spatial autocorrelation. The starting point and size of the increment are specified in the Beginning Distance and Distance Increment parameters, respectively.</para>
        /// <para>递增邻域大小并分析数据集的空间自相关的次数。增量的起点和大小分别在“起始距离”和“距离增量”参数中指定。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Number of Distance Bands")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public long _Number_of_Distance_Bands { get; set; }


        /// <summary>
        /// <para>Beginning Distance</para>
        /// <para>The distance at which to start the analysis of spatial autocorrelation and the distance from which to increment. The value entered for this parameter should be in the units of the Output Coordinate System environment setting.</para>
        /// <para>开始空间自相关分析的距离和要从中递增的距离。为此参数输入的值应为输出坐标系环境设置的单位。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Beginning Distance")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double? _Beginning_Distance { get; set; } = null;


        /// <summary>
        /// <para>Distance Increment</para>
        /// <para>The distance to increase after each iteration. The distance used in the analysis starts at the Beginning Distance and increases by the amount specified in the Distance Increment. The value entered for this parameter should be in the units of the Output Coordinate System environment setting.</para>
        /// <para>每次迭代后要增加的距离。分析中使用的距离从“起始距离”开始，并按“距离增量”中指定的量增加。为此参数输入的值应为输出坐标系环境设置的单位。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Distance Increment")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double? _Distance_Increment { get; set; } = null;


        /// <summary>
        /// <para>Distance Method</para>
        /// <para><xdoc>
        ///   <para>Specifies how distances are calculated from each feature to neighboring features.</para>
        ///   <bulletList>
        ///     <bullet_item>Euclidean—The straight-line distance between two points (as the crow flies)</bullet_item><para/>
        ///     <bullet_item>Manhattan—The distance between two points measured along axes at right angles (city block); calculated by summing the (absolute) difference between the x- and y-coordinates</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定如何计算从每个要素到相邻要素的距离。</para>
        ///   <bulletList>
        ///     <bullet_item>欧几里得 - 两点之间的直线距离（乌鸦飞翔时）</bullet_item><para/>
        ///     <bullet_item>曼哈顿 - 沿直角轴测量的两点之间的距离（城市街区）;通过将 x 坐标和 y 坐标之间的（绝对）差求和计算得出</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Distance Method")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _Distance_Method_value _Distance_Method { get; set; } = _Distance_Method_value._EUCLIDEAN;

        public enum _Distance_Method_value
        {
            /// <summary>
            /// <para>Euclidean</para>
            /// <para>Euclidean—The straight-line distance between two points (as the crow flies)</para>
            /// <para>欧几里得 - 两点之间的直线距离（乌鸦飞翔时）</para>
            /// </summary>
            [Description("Euclidean")]
            [GPEnumValue("EUCLIDEAN")]
            _EUCLIDEAN,

            /// <summary>
            /// <para>Manhattan</para>
            /// <para>Manhattan—The distance between two points measured along axes at right angles (city block); calculated by summing the (absolute) difference between the x- and y-coordinates</para>
            /// <para>曼哈顿 - 沿直角轴测量的两点之间的距离（城市街区）;通过将 x 坐标和 y 坐标之间的（绝对）差求和计算得出</para>
            /// </summary>
            [Description("Manhattan")]
            [GPEnumValue("MANHATTAN")]
            _MANHATTAN,

        }

        /// <summary>
        /// <para>Row Standardization</para>
        /// <para><xdoc>
        ///   <para>Row standardization is recommended whenever the distribution of your features is potentially biased due to sampling design or an imposed aggregation scheme.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—Spatial weights will be standardized; each weight is divided by its row sum (the sum of the weights of all neighboring features).</bullet_item><para/>
        ///     <bullet_item>Unchecked—No standardization of spatial weights is applied.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>每当要素的分布由于采样设计或强加的聚合方案而可能存在偏差时，建议进行行标准化。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 空间权重将标准化;每个权重除以其行总和（所有相邻要素的权重之和）。</bullet_item><para/>
        ///     <bullet_item>未选中 - 未应用空间权重的标准化。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Row Standardization")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _Row_Standardization_value _Row_Standardization { get; set; } = _Row_Standardization_value._true;

        public enum _Row_Standardization_value
        {
            /// <summary>
            /// <para>ROW_STANDARDIZATION</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("ROW_STANDARDIZATION")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_STANDARDIZATION</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_STANDARDIZATION")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Output Table</para>
        /// <para>The table to be created with each distance band and associated z-score result.</para>
        /// <para>要创建的表格，其中包含每个距离带和关联的 z 分数结果。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Table")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _Output_Table { get; set; } = null;


        /// <summary>
        /// <para>Output Report File</para>
        /// <para>The PDF file to be created containing a line graph summarizing results.</para>
        /// <para>要创建的 PDF 文件，其中包含汇总结果的折线图。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Report File")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _Output_Report_File { get; set; } = null;


        /// <summary>
        /// <para>First Peak</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("First Peak")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public double? _First_Peak { get; set; }


        /// <summary>
        /// <para>Maximum Peak</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Maximum Peak")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public double? _Max_Peak { get; set; }


        public IncrementalSpatialAutocorrelation SetEnv(object geographicTransformations = null, object outputCoordinateSystem = null, object scratchWorkspace = null, object workspace = null)
        {
            base.SetEnv(geographicTransformations: geographicTransformations, outputCoordinateSystem: outputCoordinateSystem, scratchWorkspace: scratchWorkspace, workspace: workspace);
            return this;
        }

    }

}